﻿using System;
using EzDesk.DesktopClient.AppModule.ViewContract;
using EzDesk.DesktopClient.Event;
using EzDesk.DesktopClient.MVVMEnhance;

namespace EzDesk.DesktopClient.AppModule.ViewModel
{
    public class MainPanelViewModel : ViewModelWithSingleContainer<IMainPanelView>
    {
        public MoreFunctionPanelViewModel MoreFunctionPanelViewModel { get; private set; }
        public ShortcutFunctionPanelViewModel ShortcutFunctionPanelViewModel { get; private set; }

        public MainPanelViewModel()
        {
            InitFields();
            MoreFunctionEvent.Instance.Subscribe(OnMoreFunction);
        }

        private void OnMoreFunction(MoreFunctionArgs moreFunctionArgs)
        {
            this.View.ShowMoreFunctions();
        }

        private void InitFields()
        {
            MoreFunctionPanelViewModel = new MoreFunctionPanelViewModel();
            ShortcutFunctionPanelViewModel = new ShortcutFunctionPanelViewModel();
        }
    }
}